﻿using System;

namespace _05_Ex02
{
    enum Orientation : byte
    {
        north = 1,
        south = 2,
        east = 3,
        west = 4
    }
    class Program
    {
        static void Main(string[] args)
        {
            byte directionByte;
            string directionString;
            Orientation myDirection = Orientation.north;
            Console.WriteLine($"myDirection = {myDirection}");
            directionByte = (byte)myDirection;
            directionString = Convert.ToString(myDirection);
            Console.WriteLine($"byte equivalent = {directionByte}");
            Console.WriteLine($"string equivalent = {directionString}");
            string myString = "north";
            Orientation myDirection2 = (Orientation)Enum.Parse(typeof(Orientation), myString);
            Console.WriteLine($"myDirection2 = {myDirection2}");
            Console.ReadKey();
        }
    }
}
